package io.github.chutian0610.sqlparser.token

import io.github.chutian0610.sqlparser.Location

/** TokenizerError
 * Error when Tokenizer parsing text.
 */
data class TokenizerError(val location: Location, val message: String) {
    constructor(message: String) : this(Location.empty(), message)

    /**
     * Create a new TokenizerError with the given location.
     */
    fun at(location: Location): TokenizerError = TokenizerError(location, message)

    override fun toString(): String {
        return "TokenizerError[$message at ${location}]"
    }
}
